package com.ruoyi.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.BdmCloudInventoryItem;
import com.ruoyi.system.domain.dto.CloudInventoryDetailDto;
import com.ruoyi.system.domain.vo.BdmCloudInventoryItemVo;
import com.ruoyi.system.mapper.BdmCloudInventoryItemMapper;
import com.ruoyi.system.service.IBdmCloudInventoryItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 云库存明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-24
 */
@Service
public class BdmCloudInventoryItemServiceImpl extends ServiceImpl<BdmCloudInventoryItemMapper,BdmCloudInventoryItem> implements IBdmCloudInventoryItemService
{
    @Autowired
    private BdmCloudInventoryItemMapper bdmCloudInventoryItemMapper;

    /**
     * 查询云库存明细
     * 
     * @param id 云库存明细主键
     * @return 云库存明细
     */
    @Override
    public BdmCloudInventoryItem selectBdmCloudInventoryItemById(Long id)
    {
        return bdmCloudInventoryItemMapper.selectBdmCloudInventoryItemById(id);
    }

    /**
     * 查询云库存明细列表
     * 
     * @param bdmCloudInventoryItem 云库存明细
     * @return 云库存明细
     */
    @Override
    public List<BdmCloudInventoryItem> selectBdmCloudInventoryItemList(BdmCloudInventoryItem bdmCloudInventoryItem)
    {
        return bdmCloudInventoryItemMapper.selectBdmCloudInventoryItemList(bdmCloudInventoryItem);
    }

    /**
     * 新增云库存明细
     * 
     * @param bdmCloudInventoryItem 云库存明细
     * @return 结果
     */
    @Override
    public int insertBdmCloudInventoryItem(BdmCloudInventoryItem bdmCloudInventoryItem)
    {
        bdmCloudInventoryItem.setCreateTime(DateUtils.getNowDate());
        return bdmCloudInventoryItemMapper.insertBdmCloudInventoryItem(bdmCloudInventoryItem);
    }

    /**
     * 修改云库存明细
     * 
     * @param bdmCloudInventoryItem 云库存明细
     * @return 结果
     */
    @Override
    public int updateBdmCloudInventoryItem(BdmCloudInventoryItem bdmCloudInventoryItem)
    {
        bdmCloudInventoryItem.setUpdateTime(DateUtils.getNowDate());
        return bdmCloudInventoryItemMapper.updateBdmCloudInventoryItem(bdmCloudInventoryItem);
    }

    /**
     * 批量删除云库存明细
     * 
     * @param ids 需要删除的云库存明细主键
     * @return 结果
     */
    @Override
    public int deleteBdmCloudInventoryItemByIds(Long[] ids)
    {
        return bdmCloudInventoryItemMapper.deleteBdmCloudInventoryItemByIds(ids);
    }

    /**
     * 删除云库存明细信息
     * 
     * @param id 云库存明细主键
     * @return 结果
     */
    @Override
    public int deleteBdmCloudInventoryItemById(Long id)
    {
        return bdmCloudInventoryItemMapper.deleteBdmCloudInventoryItemById(id);
    }

    /**
     *  后台查询云库存明细
     */
    @Override
    public List<BdmCloudInventoryItemVo> cloudInventoryDetail(CloudInventoryDetailDto cloudInventoryDetailDto) {
       return bdmCloudInventoryItemMapper.cloudInventoryDetail(cloudInventoryDetailDto);
    }
}
